<?php

namespace app\common\access;

use app\common\model\article\Article as ArticleModel;

class Article
{
    public function __construct(
        ArticleModel $articleModel
    ) {
        $this->articleModel = $articleModel;
    }

    public function check($id)
    {
        $aritlce = $this->articleModel
            ->where(['id' => $id, 'user_id' => request()->user->id])
            ->find();
        if (empty($aritlce)) {
            exception('恶意获取数据', 10000, '\app\common\exception\AccessHandler');
        }
    }
}
